<!DOCTYPE html>
<html lang="zh">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>动画状态1</title>
  <style>
    * {
      margin: 0;
      padding: 0;
      box-sizing: border-box;
    }

    .box {
      margin: 100px;
      position: relative;
      width: 600px;
      height: 100px;
      background-color: #0ff;
    }

    .moveBlock {
      position: absolute;
      top: 0;
      width: 100px;
      height: 100px;
      background-color: #00f;
      animation: moveName 1s;
    }

    /* 定义动画 */
    @keyframes moveName {
      from {
        /* css */
        width: 100px;
      }

      to {
        /* css */
        width: 600px;
      }
    }
  </style>
</head>

<body>
  <div class="box">
    <div class="moveBlock"></div>
  </div>
</body>

</html>